<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>

selection_test(
  '<div contenteditable dir="rtl">|abc\u05D0\u05D1\u05D2123def</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl">a|bc\u05D0\u05D1\u05D2123def</div>',
  '15-0 rtl left character');

selection_test(
  '<div contenteditable dir="rtl">a|bc\u05D0\u05D1\u05D2123def</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl">ab|c\u05D0\u05D1\u05D2123def</div>',
  '15-1 rtl left character');

selection_test(
  '<div contenteditable dir="rtl">ab|c\u05D0\u05D1\u05D2123def</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl">abc|\u05D0\u05D1\u05D2123def</div>',
  '15-2 rtl left character');

selection_test(
  '<div contenteditable dir="rtl">abc|\u05D0\u05D1\u05D2123def</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl">abc\u05D0|\u05D1\u05D2123def</div>',
  '15-3 rtl left character');

selection_test(
  '<div contenteditable dir="rtl">abc\u05D0|\u05D1\u05D2123def</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl">abc\u05D0\u05D1|\u05D2123def</div>',
  '15-4 rtl left character');

selection_test(
  '<div contenteditable dir="rtl">abc\u05D0\u05D1|\u05D2123def</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl">abc\u05D0\u05D1\u05D2|123def</div>',
  '15-5 rtl left character');

selection_test(
  '<div contenteditable dir="rtl">abc\u05D0\u05D1\u05D2|123def</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl">abc\u05D0\u05D1\u05D21|23def</div>',
  '15-6 rtl left character');

selection_test(
  '<div contenteditable dir="rtl">abc\u05D0\u05D1\u05D21|23def</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl">abc\u05D0\u05D1\u05D212|3def</div>',
  '15-7 rtl left character');

selection_test(
  '<div contenteditable dir="rtl">abc\u05D0\u05D1\u05D212|3def</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl">abc\u05D0\u05D1\u05D2123|def</div>',
  '15-8 rtl left character');

selection_test(
  '<div contenteditable dir="rtl">abc\u05D0\u05D1\u05D2123|def</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl">abc\u05D0\u05D1\u05D2123d|ef</div>',
  '15-9 rtl left character');

selection_test(
  '<div contenteditable dir="rtl">abc\u05D0\u05D1\u05D2123d|ef</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl">abc\u05D0\u05D1\u05D2123de|f</div>',
  '15-10 rtl left character');

selection_test(
  '<div contenteditable dir="rtl">abc\u05D0\u05D1\u05D2123de|f</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl">abc\u05D0\u05D1\u05D2123def|</div>',
  '15-11 rtl left character');

selection_test(
  '<div contenteditable dir="rtl">abc\u05D0\u05D1\u05D2123def|</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl">abc\u05D0\u05D1\u05D2123def|</div>',
  '15-12 rtl left character');
</script>
